#include "masterpanel.h"
#include "windows.h"

bool MasterPanel::isDirty()
{
	return getDirtyRectangleCount() > 0;
}

void MasterPanel::draw(SDL_Surface * a_surface)
{
	for(int i = 0; i < getDirtyRectangleCount(); ++i)
	{
		SDL_SetClipRect(a_surface, getDirtyRectangle(i));
		// clear background
		VSDL_FillRect(a_surface, 0, SDL_MapRGB(a_surface->format, 0, 255, 0));
		// draw the other content
		ParentPanel::draw(a_surface);
	}
	// clear the dirty rectangles after the draw... they'll get dirty again during update...
	clearDirtyRectangles();
}